﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AddUsersToRoleDlg.aspx.cs" Inherits="Security_AddUsersToRoleDlg" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>给角色添加用户</title>
    <link href="../css/f_css.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    #gv th
    {
        border:none;
    }
    #gv td
    {
        border-top:none;
        border-left:none;
        border-right:none;
        border-bottom:solid 1px #EEEEEE;
    }
    </style>
    <script language="javascript" src="../js/common.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        function onOK() {
            var hfItems = getx("hfItems");
            window.parent.document.onDialogCallBack(1, null, hfItems.value);
        }
    </script>
    <script language="javascript" type="text/javascript">
        function preCheckItems(gvID, confimrMsg) {
            if (0 == getCheckedItemsCount(gvID)) {
                getx("lblMsg").innerHTML = "没有选择记录";
                return false;
            }
            if (confimrMsg) {
                if (!confirm(confimrMsg)) {
                    return false;
                }
            }
            return true;
        }
        function onRowStatusChanged(chk, rowIndex) {
            var tr = chk.parentNode.parentNode;
            if (chk.checked) {
                tr.style.backgroundColor = "#d6e2f6";
            }
            else {
                tr.style.backgroundColor = "";
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div style="text-align:center; height:20px; line-height:20px;">
        <asp:Label runat="server" ID="lblMsg" ForeColor="Red" EnableViewState="false"></asp:Label>
        <asp:HiddenField runat="server" ID="hfItems" Value="0" />
    </div>
    <div style="width:99%;">
        <asp:GridView ID="gv" runat="server" CssClass="table2" AutoGenerateColumns="False">
            <Columns>
                <asp:TemplateField HeaderStyle-Width="20px" ItemStyle-HorizontalAlign="Center">
                    <HeaderTemplate>
                        <input type="checkbox" onclick="javascript:checkAll(this);" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox runat="server" ID="chk" onclick='<%# "javascript:onRowStatusChanged(this, " + Container.DataItemIndex + ");"%>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="姓名" DataField="Name" />
                <asp:BoundField HeaderText="登录名" DataField="LoginName" />
                <asp:BoundField HeaderText="工作证号" DataField="WorkNumber" />
                <asp:TemplateField HeaderText="创建日期">
                    <ItemTemplate><%# FormatDateTime(Eval("CreateDateTime"), false)%></ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <HeaderStyle CssClass="listhead" />
            <AlternatingRowStyle CssClass="alt" />
        </asp:GridView>
    </div>
    <div style="text-align:center; height:30px; line-height:30px;">
        <asp:Button runat="server" ID="btnOK" Text="添加" CssClass="input00"
            OnClientClick="javascript:if(!preCheckItems('gv')){return false;}"
            onclick="btnOK_Click" />
        <input type="button" value="完成" class="input00" onclick="javascript:onOK();" />
    </div>
    </form>
</body>
</html>
